 --status panel 
--durability code come from Tukui

  
--get the addon namespace
local addon, ns = ...
  
--get the config values
local LabelUI = ns.LabelUI
local cfg = ns.cfg

local noshow = LabelUI.noshow
local Kill = LabelUI.Kill
local point = LabelUI.point
local ShortNumber = LabelUI.ShortNumber
local textureBackground
local texturehilite
local textureBackground2
local classcolor
local playerclass
local SaveVars
local toc
local ReturnChatFunc
local CheckRaidStatus

local GetTalentId = LabelUI.GetTalentId

local LoadConfig = function()
	textureBackground = cfg.textureBackground
	texturehilite = cfg.texturehilite
	textureBackground2 = cfg.textureBackground2
	classcolor = cfg.classcolor 
	playerclass = cfg.playerclass 
	SaveVars = LabelUI.SaveVars 
	CheckRaidStatus = LabelUI.CheckRaidStatus
    toc = LabelUI.toc 
	ReturnChatFunc = LabelUI.ReturnChatFunc 
end

local spell  = (GetSpellInfo(84839))
local Slots = {
[1] = {1, "Head", 1000},
[2] = {3, "Shoulder", 1000},
[3] = {5, "Chest", 1000},
[4] = {6, "Waist", 1000},
[5] = {9, "Wrist", 1000},
[6] = {10, "Hands", 1000},
[7] = {7, "Legs", 1000},
[8] = {8, "Feet", 1000},
[9] = {16, "Main Hand", 1000},
[10] = {17, "Off Hand", 1000},
[11] = {18, "Ranged", 1000}
}

local shields = {
	["PRIEST"] = {
		["shield1"] = {
			[1] = GetSpellInfo(48168),
			[2] = GetSpellInfo(73413),	
		},
	},
}

local spells = {}

local existsshields = {}

local GetShield

local idtypes = {"stam", "sres", "stat", "mast", "inta", "agil"}

local function Default()
	spells = {}
	for _, stype in pairs(idtypes) do
		spells[stype] = {}
		spells[stype].id = {}	
	end
	spells["stam"].another = {}
	spells["agil"].another = {}
	spells["stat"].another = {}
	spells["mast"].another = {}
end

local dropdown_onload = function(self)
	for i, v in pairs(existsshields["shield"..self:GetID()]) do
		local info            = {}
       	info.text       = v
		info.checked    = (SaveVars:Get("spec_"..GetTalentId().."_shield_"..self:GetID(), v) == v)
       	info.func       = function()
			SaveVars:Set("spec_"..GetTalentId().."_shield_"..self:GetID(), v)
			GetShield()
		end
       	UIDropDownMenu_AddButton(info)
	end
end

local main_dropdown_onload = function(self, level)
	level = level or 1
	if level == 2 then
		local Level1_Key = UIDROPDOWNMENU_MENU_VALUE["Config_level1"]
     	local funcnames, func = ReturnChatFunc()
     	for i, v in pairs(funcnames) do
     		local info = UIDropDownMenu_CreateInfo()
       		info.hasArrow = false
       		info.notCheckable = true
       		info.text = v
       		info.value = {
         		["Config_level1"] = Level1_Key,
         		["Config_level2"] = v,
       		}
			info.func       = function()
				func[strlower(v)]()
			end
       		UIDropDownMenu_AddButton(info, level)
     	end
		return
	end
	local info            = {}
   	info.text       = "LabelUI"
	info.isTitle	= true
	info.notCheckable	= true
   	UIDropDownMenu_AddButton(info)
	info            = {}
   	info.text       = "Configuration"
	info.notCheckable	= true
	info.hasArrow = true
    info.value = {
       ["Config_level1"] = "Conf",
    }
    UIDropDownMenu_AddButton(info, level)
	if CheckRaidStatus() then
		info            = {}
   		info.text       = "Ready Check"
		info.notCheckable	= true
   		info.func       = function()
			DoReadyCheck()
		end
   		UIDropDownMenu_AddButton(info, level)
	end
	info            = {}
   	info.text       = "Loot History"
	info.notCheckable	= true
   	info.func       = function()
		ToggleLootHistoryFrame()
	end
   	UIDropDownMenu_AddButton(info, level)
end

local function menu(self)
	if self.dropdown.main then
		if LabelUI.DropDownPoint then
			LabelUI.DropDownPoint(self.dropdown)
		end
	else			
		if InCombatLockdown() then
			return
		end
	end
	ToggleDropDownMenu(1, nil, self.dropdown, self, 0, 0)
end

local function itinsert(table, pos, id)
	if pos == -1 then
		table[#table + 1] = id
	else
		tinsert(table, pos, id)
	end
end

 --anid - another spell id if spell name  ~= buf name (example: id = shaman's agility, anid = shaman's agility totem
local function checkspell(stype, id, class, pos, always, anid) 
	if playerclass == class then
		if GetSpellInfo(GetSpellInfo(id)) or (anid and GetSpellInfo(GetSpellInfo(anid))) then
			spells[stype].my = anid or id
			itinsert(spells[stype].id, pos, id)
			if not spells[stype].always then
				spells[stype].always = always
			end
		end
	else	
		itinsert(spells[stype].id, pos, id)
		if not spells[stype].always then
			spells[stype].always = always
		end
	end
	if anid then
		spells[stype][id] = anid
	end
end

local panel
local nextupdate = 0

local function isTank()
	local masteryIndex = GetSpecialization()
	local class = playerclass	
	local Venge = panel.text["vengeance"]
	local Text = panel.text["vengeancetext"]
	
	if masteryIndex then
    	if class == "DRUID" and masteryIndex == 2 then --need to review
			Venge.isTank = true
		elseif class == "DEATHKNIGHT" and masteryIndex == 1 then
			Venge.isTank = true
		elseif class == "PALADIN" and masteryIndex == 2 then
			Venge.isTank = true
		elseif class == "WARRIOR" and masteryIndex == 3 then
			Venge.isTank = true
		elseif class == "MONK" and masteryIndex == 1 then
			Venge.isTank = true
		else
			Venge.isTank = false
		end
	else
		Venge.isTank = false
	end
	if Venge.isTank then
		Venge:Show()
		Text:Show()	
	else
		Venge:Hide()
		Text:Hide()	
	end
end

local function CreateButton(btn, spell, id, fname)
	if not btn then
		btn = CreateFrame("Button", fname, panel, "SecureActionButtonTemplate")
		btn:SetWidth(18)
		btn:SetHeight(18)
		btn.icon = btn:CreateTexture(nil, "BORDER")
  		btn.icon:SetAllPoints(btn)
  		btn.icon:SetTexCoord(0.1,0.9,0.1,0.9)
	end
	btn:Show()
	if spell and not InCombatLockdown() then
		btn:SetAttribute("*type1", "spell")
		btn:SetAttribute("unit", "player")
		btn:SetAttribute("spell", spell)
	end
	if spell or id then
		local _, _, texture = GetSpellInfo(id or spell)
		btn.icon:SetTexture(texture)
	end
	return btn
end

GetShield = function()  
	local name = {}
	existsshields = {}
	if not panel.shield then
		panel.shield = {}
	end
	panel.shield.count = 0
	if shields[playerclass] then
		for i, v in pairs(shields[playerclass]) do
			for _, sname in pairs(v) do
				if GetSpellInfo(sname) then
					if not name[i] then 
						panel.shield.count = panel.shield.count + 1
						existsshields[i] = {}
						name[i] = sname 
					end
					tinsert(existsshields[i], sname)
				end
			end
		end
	end
	local kids = { panel:GetChildren() }
	for _,f in pairs(kids) do
		if f.dropdown and f.icon then
			f:Hide()
		end
	end
	for num = 1 ,panel.shield.count do 
	local sid = "shield"..num
	if name["shield"..num] then
		local sname = SaveVars:Get("spec_"..GetTalentId().."_shield_"..num, name[sid])
		if tContains(existsshields[sid], sname) then
			name[sid] = sname
		end
		panel.shield[sid] = CreateButton(panel.shield[sid], name[sid], nil, "LUI_ShieldButton"..num)
		if num > 1 then
			panel.shield[sid]:SetPoint("RIGHT", panel.shield["shield"..(num - 1)], "LEFT", -2, 0)
		else
			panel.shield[sid]:SetPoint("RIGHT", panel, "RIGHT", -2, 0)
		end
		panel.shield[sid].name = name[sid]
		if not panel.shield[sid].dropdown then
			panel.shield[sid].dropdown = CreateFrame("Frame", "LUI_Panel_DropDown_"..num, panel.shield[sid], "UIDropDownMenuTemplate")
			panel.shield[sid].dropdown:SetID(num)
			UIDropDownMenu_Initialize(panel.shield[sid].dropdown, dropdown_onload, "MENU")
            panel.shield[sid].dropdown.xOffset = 0
            panel.shield[sid].dropdown.yOffset = 2
            panel.shield[sid].dropdown.point = "BOTTOMRIGHT"
            panel.shield[sid].dropdown.relativePoint = "TOPLEFT"
			panel.shield[sid].menu = menu
			panel.shield[sid]:RegisterForClicks('AnyUp')
			panel.shield[sid]:SetAttribute("*type2", "menu")
		end
	else
		if panel.shield[sid] then
			panel.shield[sid]:Hide()
		end
	end
	end
end

local function CreateAvailableBufsButtons(prev, spellsbase, isself, always)
	for i,v in pairs(spellsbase) do
		if v.my and isself or (not v.my and not isself and (not v.always and not always or v.always and always)) then
			if not panel[i] or not panel[i]:IsShown() then 
				for num,id in pairs(v.id) do
					if v[id] then
						id = v[id]
					end
					local name
					if isself then 
						name = GetSpellInfo(v.my)
					end
					panel[i] = CreateButton(panel[i], name, id)
					if not isself then
						name = GetSpellInfo(id)
					end
					panel[i].name = name
					if prev then
						panel[i]:SetPoint("RIGHT", prev, "LEFT", -2, 0)
						prev = panel[i]
					else
						panel[i]:SetPoint("RIGHT", panel, "RIGHT", -2, 0)
						prev = panel[i]
					end
					break
				end
			end
		end
	end
	return prev
end

local function CheckAvailableBufs()
	local Classes = {}
	Default()
	if UnitInRaid("player") then
		local raidmem = GetNumGroupMembers()
		for i = 1, raidmem do
			local class = select(2, UnitClass("raid"..i))
			if class then
				if Classes[class] then
					Classes[class] = Classes[class] + 1
				else
					Classes[class] = 1
				end
			end
		end 
	else
		Classes[playerclass] = 1
	end
	if Classes["PRIEST"] then
		checkspell("stam", 21562, "PRIEST", 1, true)
	end	
	if Classes["PALADIN"] then
		local always
		if Classes["PALADIN"] > 1 then
			always = true
		else
			always = false
		end
		checkspell("stat", 20217, "PALADIN", 1, always)
		checkspell("mast", 19740, "PALADIN", 1, always)
		spells["stat"].another[1] = "mast" 
		spells["mast"].another[1] = "stat" 
	end
	if Classes["MONK"] then
		checkspell("stat", 115921, "MONK", 1, true)
		spells["mast"].always = true
	end
	if Classes["DRUID"] then
		checkspell("stat", 1126, "DRUID", 1, true)
		spells["mast"].always = true
	end
	if Classes["MAGE"] then
		checkspell("inta", 1459, "MAGE", 1, true)
		checkspell("inta", 61316, "MAGE", -1, true)
	end	
	if Classes["WARLOCK"] then
		checkspell("stam", 109773, "WARLOCK", 1, true)
	end	
	if Classes["WARRIOR"] then
		local always
		if Classes["WARRIOR"] > 1 or spells["stam"].always then
			always = true
		else
			always = false
		end
		checkspell("agil", 6673, "WARRIOR", 1, always)
		checkspell("stam", 469, "WARRIOR", -1, always)
		spells["stam"].another[1] = "agil" 
		spells["agil"].another[1] = "stam" 
	end	
	if Classes["DEATHKNIGHT"] then
		checkspell("agil", 57330, "DEATHKNIGHT", 1, true)
		spells["stam"].always = true
	end
	if Classes["SHAMAN"] then
		checkspell("mast", 116956, "SHAMAN", 1, true)
		spells["stat"].always = true
	end	
	local prev
	if panel.shield and panel.shield.count > 0 then 
		prev = panel.shield["shield"..panel.shield.count]
	end
	local kids = { panel:GetChildren() }
	for _,f in pairs(kids) do
		if not f.dropdown and f.icon then
			f:Hide()
		end
	end
	prev = CreateAvailableBufsButtons(prev, spells, true, false)
	prev = CreateAvailableBufsButtons(prev, spells, false, true)
	prev = CreateAvailableBufsButtons(prev, spells, false, false)
end

local function CheckCurBuff(exists, i, v, chacked, good)
	if exists then
		panel[i].icon:SetVertexColor(1, 1, 1, 1)
		if not v.always then
			good[i] = true
			for _, atype in pairs(v.another) do
				if chacked[atype] and not good[atype] then
					panel[atype].icon:SetVertexColor(1, 1, 1, 0.5)
				end
			end
		end	
	else
		if v.always then
			panel[i].icon:SetVertexColor(0.9, 0.0, 0.0, 1)
		else
			chacked[i] = true
			local red
			if #(v.another) > 0 then
				red = true
				for _, atype in pairs(v.another) do
					if 	good[atype] then
						red = false
						break
					end
				end
			else
				red = false
			end
			if red then
				panel[i].icon:SetVertexColor(0.9, 0.0, 0.0, 1)
			else
				panel[i].icon:SetVertexColor(1, 1, 1, 0.5)	
			end
		end
	end
end

local function UpdateDur()
	local Total = 0
	local current, max

	for i = 1, 11 do
		if GetInventoryItemLink("player", Slots[i][1]) ~= nil then
			current, max = GetInventoryItemDurability(Slots[i][1])
			if current then
				Slots[i][3] = current/max
				Total = Total + 1
			end
		end
	end
	table.sort(Slots, function(a, b) return a[3] < b[3] end)

	if Total > 0 then
		panel.text["dur"]:SetText(floor(Slots[1][3]*100).."%")
	else
		panel.text["dur"]:SetText("100%")
	end
	-- Setup Durability Tooltip
	--self:SetAllPoints(Text)
	Total = 0
end

local function EnterDur()
	if not InCombatLockdown() then
		--ocal anchor, panel, xoff, yoff = T.DataTextTooltipAnchor(Text)
		GameTooltip:SetOwner(panel.text["durmouseframe"], "ANCHOR_TOPLEFT", 0, 0)
		GameTooltip:ClearLines()
		for i = 1, 11 do
			if Slots[i][3] ~= 1000 then
				local green, red
				green = Slots[i][3]*2
				red = 1 - green
				GameTooltip:AddDoubleLine(Slots[i][2], floor(Slots[i][3]*100).."%",1 ,1 , 1, red + 1, green, 0)
			end
		end
		GameTooltip:Show()
	end
end

local function Update()
	if GetTime() > nextupdate then
		nextupdate = GetTime() + 1
		if panel.shield.count > 0 then
			for num = 1 ,panel.shield.count do 
				if panel.shield["shield"..num]:IsShown() then
					if UnitBuff("player", panel.shield["shield"..num].name) then
						panel.shield["shield"..num].icon:SetVertexColor(1, 1, 1)	
					else
						panel.shield["shield"..num].icon:SetVertexColor(0.9, 0.0, 0.0)	
					end
				end
			end
		end
		local chacked = {}
		local good = {}
		if UnitInRaid("player") then
			local raidmem = GetNumGroupMembers()
			for i,v in pairs(spells) do
				if panel[i] and panel[i]:IsShown() then
					local bufffound
					local exists = true
					for id = 1, raidmem do
						if UnitIsConnected("raid"..id) and UnitIsVisible("raid"..id) and not UnitIsDeadOrGhost("raid"..id) then
							local buffound = false
							for num,sid in pairs(v.id) do
								if UnitBuff("raid"..id, GetSpellInfo(sid)) then
									buffound = true
									break
								end
							end 
							if not buffound then
								exists = false
								break
							end
						end
					end
					CheckCurBuff(exists, i, v, chacked, good)
				end		
			end	
		else
			for i,v in pairs(spells) do
				if panel[i] and panel[i]:IsShown() then
					local buffound = false
					for num,sid in pairs(v.id) do
						if UnitBuff("player", GetSpellInfo(sid)) then
							buffound = true
							break
						end
					end
					CheckCurBuff(buffound, i, v, chacked, good)
				end	
			end	
		end
		if panel.text and panel.text:IsShown() then
			if panel.text["ping"] and panel.text["ping"]:IsShown() then
				local ms = select(4, GetNetStats())
				panel.text["ping"]:SetText(ms.." ms")
			end
			if panel.text["fps"] and panel.text["fps"]:IsShown() then
				panel.text["fps"]:SetText(floor(GetFramerate()))
				local left = panel.text["fps"]:GetRight() - panel:GetLeft() --fix change "fps" text position only if change more then 3
				if abs(left - panel.text["fpstext"].left) > 3 then
					panel.text["fpstext"]:SetPoint("LEFT", panel, "LEFT", left + 3.5, 0)
					panel.text["fpstext"].left = left	
				end
			end
			if false and panel.text["vengeance"] and panel.text["vengeance"] and panel.text["vengeance"].isTank then
				local value1 = nil
				value1, value2 = select(14,UnitBuff("player", spell, nil))
				if value1 == nil then
					panel.text["vengeance"]:SetText("")
					panel.text["vengeancetext"]:SetText("")
				else
					panel.text["vengeance"]:SetText(ShortNumber(value2))
					panel.text["vengeancetext"]:SetText("ven")
				end
				local left = panel.text["vengeance"]:GetRight() - panel:GetLeft()
				if abs(left - panel.text["vengeancetext"].left) > 3 then
					panel.text["vengeancetext"]:SetPoint("LEFT", panel, "LEFT", left + 3.5, 0)
					panel.text["vengeancetext"].left = left	
				end
			end
		end
	end
end

local wemustdoit = {}
local function Event(self, event, ...)
 	if event == "SPELLS_CHANGED" then
		if not InCombatLockdown() then
			wemustdoit[1] = nil
			GetShield()
			wemustdoit[2] = nil
			CheckAvailableBufs()
		else
			wemustdoit[1] = GetShield
			wemustdoit[2] = CheckAvailableBufs
		end
  elseif event == "GROUP_ROSTER_UPDATE" then 
		if not InCombatLockdown() then
			wemustdoit[2] = nil
			CheckAvailableBufs()
		else
			wemustdoit[2] = CheckAvailableBufs
		end
	elseif event == "PLAYER_REGEN_ENABLED" then  
		for i,v in pairs(wemustdoit) do
			local func = v
			wemustdoit[i] = nil
			if func then
				func()
			end
		end
	elseif event == "UPDATE_INVENTORY_DURABILITY" or event == "MERCHANT_SHOW" then
		UpdateDur()	
	elseif event == "ACTIVE_TALENT_GROUP_CHANGED'" or event == "PLAYER_TALENT_UPDATE" then
		isTank()
	end
end

local function Init()

LoadConfig()

if cfg.frames.panel then
panel = CreateFrame("Frame", "LUI_Panel", UIParent)
panel:SetPoint(cfg.frames.panel.pos.a1,point(cfg.frames.panel.pos.af),cfg.frames.panel.pos.a2, cfg.frames.panel.pos.x, cfg.frames.panel.pos.y)
panel:SetWidth(cfg.frames.panel.width)
panel:SetHeight(cfg.frames.panel.height)
panel:SetFrameStrata("BACKGROUND")
panel:SetBackdrop(texturehilite)
panel:SetBackdropColor(0, 0, 0, 0.5)
panel:SetBackdropBorderColor(0, 0, 0, 0)
panel:RegisterEvent("SPELLS_CHANGED")
panel:RegisterEvent("GROUP_ROSTER_UPDATE")
panel:RegisterEvent("PLAYER_REGEN_ENABLED")  
panel:RegisterEvent("UPDATE_INVENTORY_DURABILITY")
panel:RegisterEvent("MERCHANT_SHOW")
panel:RegisterEvent('ACTIVE_TALENT_GROUP_CHANGED')
panel:RegisterEvent('PLAYER_TALENT_UPDATE')

panel.text = CreateFrame("Frame", nil, panel)
panel.text:SetPoint("LEFT", panel, "LEFT", 2, 0)
panel.text:SetWidth(140)
panel.text:SetHeight(18)
panel.text["dur"] = panel.text:CreateFontString(nil, "OVERLAY")
panel.text["dur"]:SetPoint("LEFT", panel.text, "LEFT", 0, 0)
panel.text["dur"]:SetFont(cfg.font, 13)
panel.text["dur"]:SetJustifyH('LEFT')
panel.text["dur"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["ping"] = panel.text:CreateFontString(nil, "OVERLAY")
panel.text["ping"]:SetPoint("LEFT", panel.text["dur"], "RIGHT", 15, 0)
panel.text["ping"]:SetFont(cfg.font, 13)
panel.text["ping"]:SetJustifyH('LEFT')
panel.text["ping"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["fps"] = panel.text:CreateFontString(nil, "OVERLAY")
panel.text["fps"]:SetPoint("LEFT", panel.text["ping"], "RIGHT", 15, 0)
panel.text["fps"]:SetFont(cfg.font, 13)
panel.text["fps"]:SetJustifyH('LEFT')
panel.text["fps"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["fpstext"] = panel.text:CreateFontString(nil, "OVERLAY")
panel.text["fpstext"]:SetPoint("LEFT", panel, "LEFT", 150, 0)
panel.text["fpstext"]:SetFont(cfg.font, 13)
panel.text["fpstext"]:SetJustifyH('LEFT')
panel.text["fpstext"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["fpstext"]:SetText("fps")
panel.text["fpstext"].left = 150
panel.text["durmouseframe"] = CreateFrame("Frame", nil, panel.text)
panel.text["durmouseframe"]:SetPoint("LEFT", panel.text["dur"], "LEFT", -2, 0)
panel.text["durmouseframe"]:SetPoint("RIGHT", panel.text["dur"], "RIGHT", 0, 0)
panel.text["durmouseframe"]:SetPoint("TOP", panel, "TOP", 0, 0)
panel.text["durmouseframe"]:SetPoint("BOTTOM", panel, "BOTTOM", 0, 0)
panel.text["durmouseframe"]:SetScript("OnEnter", EnterDur)
panel.text["durmouseframe"]:SetScript("OnLeave", function() GameTooltip:Hide() end)
panel.text["vengeance"] = panel.text:CreateFontString(nil, 'OVERLAY') 
panel.text["vengeance"]:SetPoint("LEFT", panel.text["fpstext"], "RIGHT", 15, 0)
panel.text["vengeance"]:SetFont(cfg.font, 13)
panel.text["vengeance"]:SetJustifyH('LEFT')
panel.text["vengeance"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["vengeancetext"] = panel.text:CreateFontString(nil, "OVERLAY")
panel.text["vengeancetext"]:SetPoint("LEFT", panel, "LEFT", 150, 0)
panel.text["vengeancetext"]:SetFont(cfg.font, 13)
panel.text["vengeancetext"]:SetJustifyH('LEFT')
panel.text["vengeancetext"]:SetTextColor(classcolor.r, classcolor.g, classcolor.b, 1)
panel.text["vengeancetext"]:SetText("")
panel.text["vengeancetext"].left = 150

panel.button = CreateFrame("Button", nil, panel)
panel.button:SetAllPoints(panel)
panel.button:SetFrameLevel(panel.button:GetFrameLevel()-1)
panel.button.dropdown = CreateFrame("Frame", "LUI_Panel_main_DropDown", panel, "UIDropDownMenuTemplate")
UIDropDownMenu_Initialize(panel.button.dropdown, main_dropdown_onload, "MENU")
panel.button.dropdown.xOffset = 0
panel.button.dropdown.yOffset = 0
panel.button.dropdown.relativeTo = panel
panel.button.dropdown.point = "BOTTOMLEFT"
panel.button.dropdown.relativePoint = "TOPLEFT"
panel.button.dropdown.main = true
panel.button.menu = menu
--panel:RegisterForClicks('AnyUp')
--panel:SetAttribute("*type2", "menu")
panel.button:SetScript("OnClick", function()
	panel.button:menu()
end)

GetShield()
CheckAvailableBufs()
UpdateDur()
isTank()

panel:SetScript("OnUpdate", Update)
panel:SetScript("OnEvent", Event)

LabelUI.TTPoints:Set(10, panel, 0, 3)
end

end

LabelUI.CallBack.panel = {}
LabelUI:AddInit(Init, "Panel")

